lcDrwAddBlockFromFile Home

Adds one or all blocks from another drawing file.
This is useful to support block libraries, for example, by LiteCAD editor you create a drawing that contains hundreds of blocks used in your application and when needed the application loads the blocks from this drawing. Often it is more convenient than to create blocks programmatically.

 HANDLE lcDrwAddBlockFromFile (
   HANDLE hDrw,
   LPCWSTR szName,
   LPCWSTR szFileName,
   int Overwrite,
   HWND hWndParent
 );

Parameters
hDrw
  Handle to a drawing object.
szName
  The name of the new block. The name must exist in the another drawing. If an empty string is specified then will be added all blocks that defined in the another drawing.
If any block name already exists in a drawing, it will be redefined by a new one from another file, using the Overwrite mode.
szFileName
  The filename of another drawing that contains the added block. The drawing must have any of supported file format.
Overwrite
  Overwrite mode. Defines LiteCAD behaviour if copied block already exist in the drawing. Can be one of the following constants:

Value Meaning
LC_BLOCK_OVERWRITENO Do not overwrite exist block
LC_BLOCK_OVERWRITEYES Always overwrite exist block
LC_BLOCK_OVERWRITEDLG Display a dialog, where a user can choose an option.
hWndParent
  Handle to a parent window for the "Overwrite block" dialog. Specify NULL if the LC_BLOCK_OVERWRITEDLG mode is not used.

Return Value

  Handle to the first added block.
If the function fails, the return value is NULL.

Remarks

  If the copied block has references to other blocks, then they also will be copied. Also will be copied all referenced named objects, like layers, linetypes, text stylles, etc.

See Also

  lcDrwAddBlockFromDrwlcDrwAddBlockFileBlock reference